﻿function RealSearchFunc() {
    PageIndex = "0";
    if (document.getElementById("divSelectPageIndex") != null) {
        PageIndex = document.getElementById("divSelectPageIndex").selectedIndex.toString();
    }

    CaseType = document.getElementById("divCaseType").options[document.getElementById("divCaseType").selectedIndex].value;
    CaseIndex = document.getElementById("divCaseCode").value;
    DBNNo = document.getElementById("divDBNNo").value;
    subject = document.getElementById("divSubject").value;
    fromDate = document.getElementById("divSearchFromDate").value;
    toDate = document.getElementById("divSearchToDate").value;
    update = document.getElementById("divUpdate").checked.toString();
    StatusIndex = document.getElementById("divStatus").selectedIndex;
    StatusText = document.getElementById("divStatus").options[StatusIndex].value;
    CurrencyIndex = document.getElementById("divCurrency").selectedIndex;
    Currency = document.getElementById("divCurrency").options[CurrencyIndex].value;

    RetValue = Portal.Vision.SearchDebitNote.ServerSideSearchDebitNote(CaseType, CaseIndex, DBNNo, subject, fromDate, toDate, StatusText, Currency, update, PageIndex).value;
    document.getElementById("divResult").innerHTML = RetValue;
    document.getElementById("divWaiting").innerHTML = "";
}

function SearchFunc() {
    document.getElementById("divWaiting").innerHTML = "Đang đọc dữ liệu từ máy chủ...";
    setTimeout("RealSearchFunc()", 10);
}